Repository navigation
ci: read the class file version from a file, not a pipe into od -N1 (defensive) - #61
Merged
Merged
Conversation
od -N1 stops reading after byte 8, so `unzip -p ... | od` under pipefail has the shape of the tar | grep -q check that failed at random in convertapi-library-js's build on 2026-11-09. It cannot fail on GitHub's runners today: unzip writes the 16 KB class in one write(), and with SIGPIPE ignored, as on the runner, unzip -p ignores EPIPE and exits 0. With a class over 64 KB and the default SIGPIPE disposition it could, so the check now reads a file and depends on neither. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 9, 2026
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the packaging workflow’s Java 8 compatibility-check update.
No open issues 🎉
What changed in this PR
This PR defensively updates the packaging workflow’s Java 8 compatibility check to avoid a potential broken-pipe failure when od stops reading early.
Changes:
- Extracts
ConvertApi.classto$RUNNER_TEMPbefore reading its class-file version. - Preserves the version check and mismatch error message while documenting why the intermediate file is used.
| File | Description |
|---|---|
.github/workflows/build.yml |
Replaces the unzip-to-od pipe with an intermediate file for the class-version check. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Package step in
build.ymlreads the class file version withunzip -p … ConvertApi.class | od -An -j7 -N1 -tu1underset -euo pipefail.od -N1stops reading after byte 8 (yes | od -N1returns 141), so this has the shape of thetar | grep -qcheck that failed at random in convertapi-library-js'smainbuild on 2026-11-09: the reader leaves early, and if the writer is still writing,pipefailfails the step.It cannot fail on GitHub's runners today:
ConvertApi.classin onewrite()(strace), so od cannot exit while unzip is still writing. unzip writes 64 KB at a time.unzip -pignores EPIPE and exits 0 when its reader leaves early. With the default SIGPIPE disposition, as in a terminal, unzip is killed and the pipeline returns 141.This change removes both conditions and uses the same pattern as the other SDK workflows. It is defensive: nothing fails today. It turned up while checking every SDK workflow for producers piped into early-exiting readers (
grep -q,head,od -Nand similar). The only other ones are in convertapi-library-js, -node and -python.Change
The class goes to
$RUNNER_TEMP/ConvertApi.class, andodreads byte 8 from that file. The error message is unchanged. A jar without the class now stops the step with unzip'scaution: filename not matchedinstead of od'scannot skip past end of combined input.Tested
In an Ubuntu 24.04 container (unzip 6.0, GNU od 9.4, bash 5.2) with SIGPIPE ignored, as on the runner. The step's
run:script was read frombuild.ymland run withbash -euo pipefailagainst the jars built frommain(./mvnw package -DskipTests, version 0.0.0-ci.1.g2cdfce7), with./mvnwstubbed to hand over those jars:main::error::The classes are compiled for class file version 61, not 52 (Java 8)ConvertApi.classod: cannot skip past end of combined inputcaution: filename not matched: com/convertapi/client/ConvertApi.classThis PR's own Build runs the changed Package step.
The fix for the real race: ConvertAPI/convertapi-library-js#31 and ConvertAPI/convertapi-library-node#128. The same defensive change for Python: ConvertAPI/convertapi-library-python#65.
🤖 Generated with Claude Code